bug fixes and improvements for uploadtool. (#182)
authortsteven4 <tsteven4@users.noreply.github.com>
Sun, 27 May 2018 14:10:07 +0000 (08:10 -0600)
committerGitHub <noreply@github.com>
Sun, 27 May 2018 14:10:07 +0000 (08:10 -0600)
* fix body of appveyor uploads.

* give detailed instructions on appveyor upload when GITHUB_TOKEN missing.

* pick up upstream changes to upload.sh.

tools/uploadtool/upload.sh
tools/uploadtool/upload_appveyor.sh

index 03ee58aa47cb4eb0d0273fe0467c2cdd8d741635..f3995503893567b030d6963ab80306cb065b12e7 100755 (executable)
@@ -150,13 +150,14 @@ if [ "$TRAVIS_COMMIT" != "$target_commit_sha" ] ; then
   fi
 
   if [ ! -z "$TRAVIS_JOB_ID" ] ; then
-    if [ ! -z "$UPLOADTOOL_BODY" ] ; then
+    if [ -z "${UPLOADTOOL_BODY+x}" ] ; then
+      # TODO: The host could be travis-ci.org (legacy open source) or travis-ci.com (subscription or latest open source).
       BODY="Travis CI build log: https://travis-ci.org/$REPO_SLUG/builds/$TRAVIS_BUILD_ID/"
     else
       BODY="$UPLOADTOOL_BODY"
     fi
   else
-    BODY=""
+    BODY="$UPLOADTOOL_BODY"
   fi
 
   release_infos=$(curl -H "Authorization: token ${GITHUB_TOKEN}" \
index 4ca22274e58dfdb8e6f379ea3f5a0ec95ebdc9b5..ac7c9020171da439d52070bbb9e8b5faa5834318 100755 (executable)
@@ -80,8 +80,11 @@ if [ ! -z "$APPVEYOR_REPO_NAME" ] ; then
   echo "APPVEYOR_REPO_COMMIT: $APPVEYOR_REPO_COMMIT"
   REPO_SLUG="$APPVEYOR_REPO_NAME"
   if [ -z "$GITHUB_TOKEN" ] ; then
-    echo "\$GITHUB_TOKEN missing, please set it in the Appveyor CI settings of this project"
-    echo "You can get one from https://github.com/settings/tokens"
+    echo "\$GITHUB_TOKEN missing."
+    echo "You can get one from https://github.com/settings/tokens."
+    echo "Encrypt it at https://ci.appveyor.com/tools/encrypt when logged into Appveyor account $APPVEYOR_ACCOUNT_NAME,"
+    echo "then set it at https://ci.appveyor.com/project/$APPVEYOR_ACCOUNT_NAME/$APPVEYOR_PROJECT_SLUG/settings/environment or"
+    echo "put it in appveyor.yml as described at https://www.appveyor.com/docs/build-configuration/#secure-variables"
     exit 1
   fi
 else
@@ -151,13 +154,13 @@ if [ "$APPVEYOR_REPO_COMMIT" != "$target_commit_sha" ] ; then
   fi
 
   if [ ! -z "$APPVEYOR_JOB_ID" ] ; then
-    if [ ! -z "$UPLOADTOOL_BODY" ] ; then
-      BODY="Appveyor CI build log: https://ci.appveyor.com/project/$REPO_SLUG/build/$APPVEYOR_BUILD_VERSION/"
+    if [ -z "${UPLOADTOOL_BODY+x}" ] ; then
+      BODY="Appveyor CI build log: https://ci.appveyor.com/project/$APPVEYOR_ACCOUNT_NAME/$APPVEYOR_PROJECT_SLUG/build/$APPVEYOR_BUILD_VERSION/"
     else
       BODY="$UPLOADTOOL_BODY"
     fi
   else
-    BODY=""
+    BODY="$UPLOADTOOL_BODY"
   fi
 
   release_infos=$(curl -s -S -H "Authorization: token ${GITHUB_TOKEN}" \